import module from '../../module'

export default name => {
  const root = `${module.code}/${name}/`
  const crud = $http.crud(root)
  // 车辆列表
  crud.vehicleQuery = params => {
    return $http.get('/baseInfo/vehicle_info/query', params)
  }
  // 修改运行班次检票口
  crud.changecheckport = params => {
    return $http.post('/dispatch/common/changecheckport', params)
  }
  // 修改运行班次号
  crud.changevehicle = params => {
    return $http.post('/dispatch/common/changevehicle', params)
  }
  // 停班或者复班
  crud.stoporrunbusinfo = params => {
    return $http.post('/dispatch/common/stoporrunbusinfo', params)
  }
  //新增环境车次
  crud.envBusInfoAdd = params => {
    return $http.post('/dispatch/env_bus_info/add', params)
  }
  // 查询计划车次
  crud.querybusinfoforselect = params => {
    return $http.get('/dispatch/common/querybusinfoforselect', params)
  }
  //查询线路
  crud.querylineinfo = params => {
    return $http.get('/dispatch/common/querylineinfo', params)
  }
  //汽车站查询
  crud.organizationQuery = params => {
    return $http.get('/baseinfo/organization/query', params)
  }
  //查询运行车次列表信息
  crud.queryrunbusinfolist = params => {
    return $http.get('/dispatch/common/queryrunbusinfolist', params)
  }
  // 查询计划班次票价 
  crud.busPriceQuery = params => {
    return $http.get('/dispatch/bus_price/query', params)
  }
  // 环境车次票价查询
  crud.envBusPriceQuery = params => {
    return $http.get('/dispatch/env_bus_price/query', params)
  }
  //生成运行班次
  crud.createenvbusinfo = params => {
    return $http.post('/dispatch/common/createenvbusinfo', params)
  }
  //根据id查询编辑详情
  crud.queryrunbusinfodetail = params => {
    return $http.get('/dispatch/common/queryrunbusinfodetail', params)
  }
  //目的站点查询
  crud.tartgetInfoQuery = params => {
    return $http.get('/baseinfo/target_info/query', params)
  }
  // 复制加班生成运行班次
  crud.copyadd = params => {
    return $http.post('/dispatch/common/copyadd', params)
  }
  // 查询车属公司
  crud.companyQuery = params => {
    return $http.get('/baseinfo/company/query', params)
  }
  //修改运行班次信息
  crud.modifyrunbus = params => {
    return $http.post('/dispatch/common/modifyrunbus', params)
  }
  // 查询线路明细-环境车次 //编辑时用
  crud.queryrunlinedetailinfo = params => {
    return $http.get('/dispatch/common/queryrunlinedetailinfo', params)
  }
  return {
    ...crud
  }
}
